package com.kefu.chat.vo;

import javax.validation.constraints.NotEmpty;

import com.kefu.chat.model.ChatConversation;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractUpdateVo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author CodeGenerator
 * @date 2022/08/15
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "内部会话")
public class ChatConversationUpdateVo extends AbstractUpdateVo<ChatConversation,String> {

    @NotEmpty
    @ApiModelProperty(value = "主键")
    private String conversationId;
    @ApiModelProperty(value = "会话名称")
    private String name;
    @ApiModelProperty(value = "会话类型，0单聊，1群聊")
    private Integer type;
    @ApiModelProperty(value = "会话坐席id从小到大，逗号分隔")
    private String users;

    @Override
    public ChatConversation convert() {
        ChatConversation info = new ChatConversation();
        info.setName(name);
        info.setType(type);
        info.setUsers(users);
        KefuContext context = KefuContext.getKefuContext();
        info.setConversationId(conversationId);
        return info;
	}
}